<template>
  <div>
    <router-view />
  </div>
</template>
<script setup lang="ts">
const { proxy } = getCurrentInstance() as any;
const router = useRouter();

onMounted(() => {
  let fo = sessionStorage.getItem("frist-open");
  let env = proxy.isMobile ? "mobile" : "pc";
  if (!fo || fo != env) {
    const route = useRoute();
    if (route.path === "/") {
      sessionStorage.setItem("frist-open", env);
      const path = proxy.isMobile ? "/m/index" : "/pc/index"; // 移动端首页、pc端首页
      router.replace(path);
    }
  }
});
</script>
<style lang="scss">
body {
  margin: 0;
  padding: 0;
}
</style>
